package com.hc.controller;

import com.hc.model.AvgTempModel;
import com.hc.service.IRefrigeratormvService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/refrigeratormonth")
@Api("/冰箱月返回数据")
public class RefrigeratorController {

    @Autowired
    private IRefrigeratormvService refrigeratormvService;


    @GetMapping("/selectmonth")
    public Map<String, List<AvgTempModel>> refrigeratormonth(String equipment, String startTime, String endTime) {

        Map<String, List<AvgTempModel>> stringListMap = refrigeratormvService.selectTempmonth(equipment, startTime, endTime);

        return stringListMap;
    }
    @GetMapping("/selectday")
    public Map<String, List<AvgTempModel>> refrigeratorday(String date) {
        Map<String, List<AvgTempModel>> map = refrigeratormvService.selectTemp(date);
        return map;
    }
}
